//************************************************************************
//     dfclient.h
//     2009 © DigiFi Limited
//
//     This is the main headerfile for the library that includes all other
//     headers as part of it
//
//************************************************************************

#ifndef DFCLIENT_HEADER
#define DFCLIENT_HEADER

#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <errno.h>
#include <pthread.h>
#include <unistd.h>

#include "dftypes.h"
#include "dfsocket.h"
#include "dfregex.h"
#include "dferrors.h"

#include "dfmultithread.h"

#include "dfdiscover.h"

#include "dfrget.h"
#include "dfrow.h"
#include "dfget.h"
#include "dfset.h"
#include "dfvoid.h"

// define settings
#define DF_DEFAULT_TIMEOUT 	3
#define DF_RGET_SPIN 2

#define DF_SOPHIA_PORT 		2921
#define DF_RGET_PORT		27378

// #define DF_DEBUG 0



//   df_connect()
//   ipaddress:  the ipaddress of the digifi to connect to
//   num_threads:  number of threads to use in communication
//
//   This function connects to a remote digifi and sets up the
//   communication threads
//
int df_connect(char *ipaddress, int num_threads, void (*callback)(int));



//   df_connected()
//
//   Returns a value indicating whether we are currently connected
//
int df_connected(void);



//   df_disconnect()
//
//   This function disconnects from sockets, ends threads and frees memory
//
void df_disconnect(void);


//   df_queuecommand()
//   type:  the type of command it is
//   regex_name:  the name of the regex to use to parse it
//   callback:  the function to call back to when its complete
//   command:  the string to send to the digifi
//
//   This function queues a command to be actioned by the communication 
//   threads
//
int df_queuecommand(df_commandtype type, char *regex_name, void (*callback)(void), char *command, ...);





#endif